package com.axzh.interview.collection;

import java.util.HashMap;
import java.util.Iterator;

public class HashMapStructure {

	public static void main(String[] args) {
		Country india = new Country("India", 1000);
		Country japan = new Country("Japan", 10000);
		Country france = new Country("France", 2000);
		Country russia = new Country("Russia", 20000);

		HashMap<Country, String> countryHashMap = new HashMap<>();
		countryHashMap.put(india, "Delhi");
		countryHashMap.put(japan, "Tokyo");
		countryHashMap.put(france, "Paris");
		countryHashMap.put(russia, "Moscow");

		/*for(Map.Entry<Country, String> e:countryHashMap.entrySet()) {
			e.getKey();
			e.getValue();
		}*/
		
		Iterator<Country> countryCapitalIter = countryHashMap.keySet()
				.iterator();
		while (countryCapitalIter.hasNext()) {
			Country countryObj = countryCapitalIter.next();
			String capital = countryHashMap.get(countryObj);
			System.out.println(countryObj.getName() + "----" + capital);
		}
	}

}
